// 权限路由
import './permission';
// svg-icons注册导入
import 'virtual:svg-icons-register';
import 'element-plus/dist/index.css';
// 引入暗黑模式 element-plus 2.2 内置暗黑模式
import 'element-plus/theme-chalk/dark/css-vars.css';
// 自定义暗黑模式
import '@/styles/element-dark.scss';
// 引入阿里图标库
import '@/assets/iconfont/iconfont.css';
import '@/assets/iconfont/iconfont.js';

import { createApp } from 'vue';

// UI框架 element-plus
import ElementPlus from 'element-plus';

// 引入全局组件布局
import XCard from '@/components/card/index.vue';
import PageWrapLayout from '@/components/PageWrapLayout/index.vue';
import SearchForm from '@/components/SearchForm/index.vue';
import SvgIcon from '@/components/SvgIcon/index.vue';// svg component
import XPropTable from '@/components/Table/PropTable/index.vue';
import { registerElIcons } from '@/plugins/ElIcons';
import {
  directivebt,
  throttle
} from '@/utils/directives';

import App from './App.vue';
import router from './routers';
import pinia from './store';

const app = createApp(App)
registerElIcons(app)
directivebt(app)//权限指令
throttle(app)//节流指令

app.component('svg-icon', SvgIcon)
app.component('PageWrapLayout', PageWrapLayout)
app.component('XCard', XCard)
app.component('SearchForm', SearchForm)
app.component('XPropTable', XPropTable)
app.use(router)
app.use(pinia)
app.use(ElementPlus).mount('#app')